package nojava;

import java.io.*;

public class Main {
    public static void main(String[] args) throws Exception {
        File fileInput = new File("c://myfile.txt");
        File fileOut = new File("d://m.txt");
        BufferedReader in = new BufferedReader(new FileReader(fileInput));
        //BufferedWriter out = new BufferedWriter(new FileWriter(fileOut,true));
//        PrintWriter out = new PrintWriter(new FileWriter(fileOut,true));
        PrintWriter out = new PrintWriter(new BufferedOutputStream(new FileOutputStream(fileOut,true)));
//        PrintStream out = new PrintStream( new BufferedOutputStream(new FileOutputStream(fileOut,true)));
        while (true){
            String s = in.readLine();
            if(s==null)break;
            out.println(s);
        }
        out.flush();//不要忘记
        System.out.println("OK1");
        in.close();
        out.close();
    }
}

// 字节: BufferedInputStream  和 BufferedOutputStream
// BufferedReader  和   PrintWriter
// Scanner  和  PrintWriter
